package com.yt.lxh.model.activity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yt.lxh.enums.CouponRangeType;
import com.yt.lxh.enums.CouponStatus;
import com.yt.lxh.enums.CouponType;
import com.yt.lxh.model.base.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.io.Serializable;

/**
 * 优惠券信息(CouponInfo)实体类
 */
@Data
@ApiModel(description = "优惠券信息(CouponInfo)实体类")
@TableName("coupon_info")
public class CouponInfo extends BaseEntity implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "优惠券ID")
    @TableId
    private Long id;

    @ApiModelProperty(value = "优惠券类型 0(无门槛) 1(满减) 2(每满减) 3(折扣)")
    @TableField("coupon_type")
    private CouponType couponType;

    @ApiModelProperty(value = "优惠券名称")
    @TableField("coupon_name")
    private String couponName;

    @ApiModelProperty(value = "优惠金额")
    @TableField("amount")
    private BigDecimal amount;

    @ApiModelProperty(value = "优惠门槛：满减/每满减(填抵扣金额门槛) 折扣(比如8折填80) 无门槛填0")
    @TableField("condition_amount")
    private BigDecimal conditionAmount;

    @ApiModelProperty(value = "可以领取的开始日期")
    @TableField("start_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    private Date startTime;

    @ApiModelProperty(value = "可以领取的结束日期")
    @TableField("end_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    private Date endTime;

    @ApiModelProperty(value = "使用范围 0(全场通用) 1(指定分类) 2(指定商品)")
    @TableField("range_type")
    private CouponRangeType rangeType;

    @ApiModelProperty(value = "范围业务id")
    @TableField("range_id")
    private String rangeId;

    @ApiModelProperty(value = "使用范围描述")
    @TableField("range_desc")
    private String rangeDesc;

    @ApiModelProperty(value = "发行数量")
    @TableField("publish_count")
    private Integer publishCount;

    @ApiModelProperty(value = "每人限领张数")
    @TableField("per_Limit")
    private Integer perLimit;

    @ApiModelProperty(value = "已使用数量")
    @TableField("use_count")
    private Integer useCount;

    @ApiModelProperty(value = "领取数量")
    @TableField("receive_count")
    private Integer receiveCount;

    @ApiModelProperty(value = "优惠券有效期类型；0(天数) 1(指定时间)")
    @TableField("expire_type")
    private Integer expireType;

    @ApiModelProperty(value = "过期时间")
    @TableField("expire_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH-mm-ss")
    private Date expireTime;

    @ApiModelProperty(value = "过期天数 ---> 按天数计算")
    @TableField("expire_day")
    private Integer expireDay;

    @ApiModelProperty(value = "状态 0(未发布) 1(未开始) 2(进行中) 3(已结束) 4(暂停使用)")
    @TableField("status")
    private CouponStatus status;

}

